title = "促销产品"
url = "/sale.html"
layout = 'default'
==
function onStart(){
$cids = [4686, 4671, 4679, 4664, 4693];
$products = [];
foreach($cids as $id){
    $patchProducts = App::make('Jason\Ccshop\Controllers\Products')->getCategoryProducts($id, ['saled' => 'desc'], false, 1, 50);
    $products = array_merge($products, $patchProducts['data']);
}
$this['products'] = $products;
}
==
<div class="category_content">
    <div class="itemList">
        <ul class="listUl">
            {% if count(products) == 0 %}
            <p class="searchPrompt">大変申し訳ありませんが、関連商品は見つけませんでした。</p>
            {% else %}
            {% partial 'catalog/list-products' products = products %}
            {% endif %}
        </ul>

    </div>
</div>